/**
 * For test - none view
 * 
 * @author Caio Thomas
 */
package view;

import model.constraints.XDF;
import model.validator.ValidateSaxParse;
import model.validator.XDFValidate;

public class InitialConsole 
{	
	//private String filename = "file:///home/caio/Documents/workspace-ic/TesteWeb/contact.xml";
	//private String filename = "file:///home/caio/Documents/workspace-ic/TesteWeb/xdf.xml";
	private String filename = "file:///home/caio/Documents/contact.xml";
	
	private String contex = "agenda";
	private String left = "contato / id";
	private String typeLeftPath = "v";
	private String right = "contato";
	private String typeRightPath = "n";
	
	/*
	
	//para todo contexto de agenda, um endereco deve ter telefone iguais
	private String contex = "agenda";
	private String left = "contato / endereco / rua | contato / endereco / numero | contato / endereco / estado | contato / endereco / cidade ";
	private String typeLeftPath = "v,v,v,v";
	private String right = "contato / phones / fixo";
	private String typeRightPath = "v";
	*/
	
	/*
	//cada celular so pode ser associado a um endereco 
	private String contex = "agenda";
	private String left = "contato / phones / celular";
	private String typeLeftPath = "v";
	private String right = "contato / endereco";
	private String typeRightPath = "n";
	*/
	
	/*
	private String contex = "agenda";
	private String left = "contato / phones / celular";
	private String typeLeftPath = "v";
	private String right = "contato";
	private String typeRightPath = "n";	
	*/
	
	
	/*
	private String contex = "bd";
	private String left = " projet / fournisseur / composant / cnom | projet / fournisseur / fnom";
	private String typeLeftPath = "v,v";
	private String right = "projet / fournisseur / composant / quantite";
	private String typeRightPath = "v";	
	*/
	
	/*
	private String contex = "bd";
	private String left = " projet / fournisseur / fnom";
	private String typeLeftPath = "v";
	private String right = "projet / fournisseur ";
	private String typeRightPath = "n";
	*/

	
	public InitialConsole(){
		ValidateSaxParse val = new ValidateSaxParse();
		XDF xdf = new XDF();
		
		xdf.setNameConstraint("xdf");
		xdf.setContextFsa("agenda");
		xdf.setSourceFsa(" contato/phones/ celular | contato/ nome | contato / email");
		xdf.setEquality("v,v,v","l");
		xdf.setTargetFsa("contato");
		xdf.setEquality("n","r");	
		
		System.out.println("Contex Fsa: " + xdf.getContext().toString());				
		System.out.println("Source Fsa: " + xdf.getSourceFsa().toString());
		System.out.println("Target Fsa: " + xdf.getTargetFsa().toString());
		
		val.add(new XDFValidate(xdf));
		val.parse(filename);
	}
	
	public static void main(String[] args){
		new InitialConsole();		
	}		
}
